import React from 'react';                                // react核心包
import { render } from 'react-dom';                       // react虚拟节点
import { AppContainer } from 'react-hot-loader';          // react热启动
import './store/stores';
import {Provider} from 'mobx-react';
import {hotRehydrate, rehydrate} from 'rfx-core';
import {isProduction} from './utils/constants';
const store = rehydrate();

import Root from './containers/Root';                     // 取得根节点信息
import 'babel-polyfill'

render(
  <AppContainer>
    <Provider store={isProduction ? store : hotRehydrate()}>
      <Root/>
    </Provider>
  </AppContainer>,
  document.getElementById('root')
);

/* alert(111);
console.log('hahahahahahahah ',module.hot);
if (module.hot) {
  module.hot.accept('./containers/Root', () => {
    const RootContainer = require('./containers/Root').default;
    render(
      <AppContainer>
        <RootContainer
          store={ store }
        />
      </AppContainer>,
      document.getElementById('root')
    );
  });
} */
